var mongoose = require("mongoose");
var url = "mongodb://localhost:27017/mydb?authSource=admin"; //本地数据库地址

let User = require("./models/userSchema")
mongoose.connect(url, { useNewUrlParser: true, useUnifiedTopology: true }, (err, db) => {
    let user = new User({
        account:"123456789",//用户ID
        name:"恒星",//用户名称
        phone:"13532792717",//用户电话
        sex:"男",//用户性别
        age:"19",//用户年龄
        email:"123456789@qq.com",//用户邮箱
        password:"123456789",//用户密码
        
        
    })
    User.create(user, (err) => {
        if (err)
            console.log("创建失败")
        else
            console.log("创建成功")
            //
    })
})